/**
 * Created by sunkejun on 2015/10/15.
 */


$(document).ready(function(){
    asyncManger.init();
})

var asyncManger  = (function ($) {
    //...
    return {

        init:function(){

            var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
                lineNumbers: true,
                matchBrackets: true,
                styleActiveLine: true,
            });
            editor.setSize(this.width, 300);
            this.$editor = editor;


        },
        saveMessage: function () {
            //console.log(this.$editor.getValue());
            ComdataUtil.ajaxpost("/admin/saveasync",{value:this.$editor.getValue()},function(){

            });

        }
    }
})(jQuery);